<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <title>正则扩展-反向断言</title>
</head>

<body>

  <script>
    // 声明字符串
    let str = '5211214你知道吗555啦啦啦';

    // 正向断言
    const reg = /\d+(?=啦)/

    const result = reg.exec(str)
    console.log(result[0]); // 555

    /*     // 反向断言
        const reg = /(?<=吗)\d+/
        const result = reg.exec(str)
        console.log(result); // 555 */
  </script>
</body>

</html>